-- SCAttackAction
-- create by chendh
-- 攻击行为

SCAttackAction = class("SCAttackAction", function()
    return ActionBase.create();
end);
function SCAttackAction.create(source, target, skillId, args)
    local self = SCAttackAction.new();
    self.source = source;
    self.target = target;
    self.skillId = skillId;
    self.args = args;

    return self;
end

-- 构造函数
function SCAttackAction:ctor()
end

-- 开始播放
function SCAttackAction:play()
    local delay = 2;
    local skillId = self.skillId;

    if type(skillId) == "number" and skillId > 0 then
        delay = SkyShipSkillM.query(skillId, "setup");
    end

    -- 抛出远程怪攻击事件
    EventMgr.fire(event.SKY_COMBAT_ATTACK, {
        ["source"] = self.source,
        ["target"] = self.target ,
        ["skillId"] = self.skillId,
        ["args"] = args,
    });

    return delay;
end

return SCAttackAction;